package zip;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.util.zip.ZipInputStream;

public class ZIPUtil {

	
	public static String unzip2 (byte [] arquivo) throws Exception{
		
        ZipInputStream zis= new ZipInputStream(new ByteArrayInputStream(arquivo));
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        
		byte[] buffer = new byte[1024];
        
        int len=0;
        zis.getNextEntry();
        while((len=zis.read(buffer))>0){

        	out.write(buffer, 0, len);
        }

        zis.close();
        return out.toString();
	}

	
	
}
